﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Chapter19.Example07
{
    public partial class ResultPage : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!PreviousPage.IsValid)
                {
                    labelResult.Text = "上一页有错误";
                    return;
                }
                var ri = PreviousPage.RegistrationInfo;
                labelResult.Text = string.Format("{0} {1} 选择的事件是 {2}.", ri.FirstName, ri.LastName, ri.SelectedEvent);
            }
            catch
            {
                labelResult.Text = "源页面必须包含姓名和邮箱控件";
            }
        }
    }
}